<%@ page import="model.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<%! User user = null; %>
<%
    user = ((User) request.getSession().getAttribute("user"));
    if (user == null) response.sendRedirect("/");
%>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>电子公文传输系统</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css?v=<%= System.currentTimeMillis()%>" />
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/public.css?v=<%= System.currentTimeMillis()%>" />
</head>
<body>
<!--头部-->
<header class="publicHeader">
    <h1>电子公文传输系统</h1>
    <div class="publicHeaderR">
        <p>用户 <span style="color: #e8ff00"><%=user.getName()%></span>  已登录</p>
        <a href="${pageContext.request.contextPath }/logout">退出登录</a>
    </div>
</header>
<!--时间-->
<section class="publicTime">
    <span id="time">2022年12月3日 11:11  星期一</span>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css?v=<%= System.currentTimeMillis()%>" />
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/public.css?v=<%= System.currentTimeMillis()%>" />
</section>
<!--主体内容-->
<section class="publicMian ">
    <div class="left">
        <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css?v=<%= System.currentTimeMillis()%>" />
        <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/public.css?v=<%= System.currentTimeMillis()%>" />
        <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
        <nav>
            <ul class="list">
                <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css?v=<%= System.currentTimeMillis()%>" />
                <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/public.css?v=<%= System.currentTimeMillis()%>" />
                <li><a href="${pageContext.request.contextPath }/send">发送公文</a></li>
                <c:if test="${user.level == '绝密级' }">
                    <li><a href="${pageContext.request.contextPath }/level">用户授权</a></li>
                </c:if>
                <c:choose>
                    <c:when test="${count == 0}">
                        <li><a href="${pageContext.request.contextPath }/list">收件箱</a></li>
                    </c:when>
                    <c:otherwise>
                        <li><a href="${pageContext.request.contextPath }/list">收件箱(${count })</a></li>
                    </c:otherwise>
                </c:choose>
                <li><a href="${pageContext.request.contextPath }/share">公文共享</a></li>
                <li><a href="${pageContext.request.contextPath }/logout">退出系统</a></li>
            </ul>
        </nav>
    </div>
    <input type="hidden" id="path" name="path" value="${pageContext.request.contextPath }"/>
    <input type="hidden" id="referer" name="referer" value="<%=request.getHeader("Referer")%>"/>